<?php 
	session_start();
	require_once('../../db_con/dbconnect.class.php');    //导入class文件
	require_once('../../conf/db_config.php');
	header('Content-Type:text/html;charset=utf-8');

	if ($_POST) {
		$username = $_POST['username'];
		$password = $_POST['password'];
		$remember = $_POST['remember'];
		$dbconnect = new dbconnect($localhost,$username,$password,$dbname);
		$data = $dbconnect->select('t_sys_user',array('username'=>$username));
		if ($data) {
			if ($data['password'] == md5($data['salt'].$password)) {//登录成功
				$return_data['status'] = 1;
				$return_data['msg'] = '登录成功！';
			}else{//密码错误
				$return_data['status'] = 0;
				$return_data['msg'] = '密码错误！';
			}
		}else{//帐号错误
			$return_data['status'] = -1;
			$return_data['msg'] = '帐号错误';
		}
	}else{
		$return_data['status'] = -2;
		$return_data['msg'] = '网络错误';
	}
	echo json_encode($return_data);

 ?>